<?php
	require '../../include/library.inc.php';
	require '../../include/admin_login.inc.php';
	
	$user_id = intval($_GET['user_id']);
	$publish = intval($_GET['publish']);
	
	if($user_id) {
		if($user_id == '1')
	  	{
		  $_SESSION['message'] = 'You can\'t change this user!';
	  	}else{
		$sql = "UPDATE 
				  users
				SET
				  accsess = $publish
				WHERE
				  user_id = '$user_id'
				 ";
		query($sql);
		}
	}
	
	redirect("users.php");
?>